package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysMenuDAO;
import com.pmh.hrs.sys.service.SysMenuService;
import com.pmh.hrs.sys.vo.SysMenuVO;

@Service("sysMenuService")
public class SysMenuServiceImpl implements SysMenuService{

	@Resource(name="sysMenuDAO")
	private SysMenuDAO sysMenuDAO;
	
	
	private SysMenuVO convertSysMenuVO(Map<String,Object> paramMap) throws Exception{
		SysMenuVO sysMenuVO = new SysMenuVO();
		BeanUtils.copyProperties(paramMap, sysMenuVO);
		return sysMenuVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysMenuVO sysMenuVO =  this.convertSysMenuVO(paramMap);
		return sysMenuDAO.insert(sysMenuVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysMenuVO sysMenuVO =  this.convertSysMenuVO(paramMap);
		return sysMenuDAO.update(sysMenuVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysMenuDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysMenuDAO.selectList(paramMap);
	}

}
